using UnityEngine;

public class speedline : MonoBehaviour
{
	public Material material;

	public float speed = 1f;

	private void Start()
	{
		material = base.gameObject.GetComponent<Renderer>().sharedMaterial;
	}

	private void Update()
	{
		material.mainTextureOffset = new Vector2(0f, Time.time * speed);
		Vector2 mainTextureOffset = material.mainTextureOffset;
		if (mainTextureOffset.y >= 10f)
		{
			material.mainTextureOffset -= new Vector2(0f, 10f);
			return;
		}
		Vector2 mainTextureOffset2 = material.mainTextureOffset;
		if (mainTextureOffset2.y <= -10f)
		{
			material.mainTextureOffset += new Vector2(0f, 10f);
		}
	}
}
